
import java.util.ArrayList;
import java.util.List;

/*
 * To change this template, choose Tools | Templates and open the template in
 * the editor.
 */
/**
 *
 * @author YixinGeng This is the class used to define the path. The path is
 * stored as a list of integer which is the id of the nodes.
 */
public class Path {

    int pathLength;
    private String path;
    private List<Integer> pathNodes = new ArrayList<Integer>();

    public List<Integer> getPathNodes() {
        return pathNodes;
    }

    public void setPath(String userPath) {
        path = userPath;
    }

    public String getPath() {
        return path;
    }

    public Path(String userPath) {
        path = userPath;
        String delims = "[->]+";
        String[] tokens = path.split(delims);
        pathLength = tokens.length;
        for (int i = 0; i < pathLength; i++) {
            pathNodes.add(Integer.parseInt(tokens[i]));

        }

    }
}
